define(function(require){

    require('./bower_components/bootstrap/dist/css/bootstrap.css');
    require('./resource/css/app.css');
    require('./controllers/controllers');
    require('./tools/filters');

    var phonecatApp = angular.module('phonecatApp', [
        'ngRoute',
        'phonecatControllers',
        'phonecatFilters'
    ]);

    phonecatApp.config(['$routeProvider',
      function($routeProvider) {
        $routeProvider.
          when('/:module', {
            //templateUrl: seajs.data.vars.tpl+'phone-list.html',
            //controller: 'PhoneListCtrl'
            templateUrl: function(params){
                return seajs.data.vars.tpl+params.module+'.html';
            },
           
            controller: function(params) {
                return name = params.module+'Ctrl';
            },
            controllerUrl: function(prams) {

            },
            //controllerAs
            resolve: function() {
                /* 
                load : function($q, $timeout){
                     var deferred = $q.defer();
                     require.async('../views/'+obj.name,function(module){
                        deferred.resolve();
                     });
                     require([loadController], function () {
                        $rootScope.$apply(function () {
                        deferred.resolve();
                     });
                     return deferred.promise;
                }
                */                 
            }
          }).
          when('/phones/:phoneId', {
            templateUrl : seajs.data.vars.tpl+'phone-detail.html',
            controller: 'PhoneDetailCtrl'
          }).
          otherwise({
            redirectTo: '/phones'
          });
      }]);
});
